import { createRouter, createWebHistory, RouteRecordRaw } from 'vue-router'

const routes: RouteRecordRaw[] = [
    {
        path: '/home',
        name: 'Home',
        component: () => import('../views/Home.vue'),
        alias: ['/', '/Home'],
    },
    {
        path: '/analysis',
        name: 'Analysis',
        component: () => import('../views/analysis.vue'),
    },
    {
        path: '/send',
        name: 'Send',
        component: () => import('../views/send.vue'), // 确保这个组件文件存在
        children:[
            {
                path: '/send/tcp',
                name: 'tcp',
                component: () => import('../views/send/tcp.vue')
            },
            {
                path: '/send/udp',
                name: 'udp',
                component: () => import('../views/send/udp.vue'),
            },
            {
                path: '/send/ip',
                name: 'ip',
                component: () => import('../views/send/ip.vue'),
            },
            {
                path: '/send/mac',
                name: 'mac',
                component: () => import('../views/send/mac.vue'),
            },
            {
                path: '/send/arp',
                name: 'arp',
                component: () => import('../views/send/arp.vue'),
            },
        ]
    }
]

const router = createRouter({
    history: createWebHistory(import.meta.env.BASE_URL),
    routes
})

export default router